export LC_ALL="zh_CN.UTF-8"
export LANG="zh_CN.UTF-8"
TARGET_JAR_NAME=$1
TARGET_PATH=/home/deployer/workspace/$TARGET_JAR_NAME/$TARGET_JAR_NAME.jar
SERVICE_JAVA_OPT="$2 -Dfile.encoding=UTF-8 -Dbiz.mark=s-$1"
if [[ -z $1 ]]; then
        echo "miss soaJarName"
        exit
fi
mkdir -p /home/deployer/workspace/$TARGET_JAR_NAME
pkill -f "$TARGET_JAR_NAME.jar"
ps -ef|grep "biz.mark=s-$1"|awk '{print $2}'|xargs kill -9
sleep 3s
cp /home/deployer/projects/$TARGET_JAR_NAME.jar $TARGET_PATH
nohup java -jar $SERVICE_JAVA_OPT $TARGET_PATH > /home/deployer/workspace/logs/$TARGET_JAR_NAME.logs 2>&1 &